import events.IEventListener;
import events.event.*;


public class CharactersCounter implements IEventListener {
  private int totalCharCount = 0;
  
  @Override
  public void executeEvent(Event event) {
    // Pobierz liczbę znaków w przekazanym tekście.
    int charCount = ((KeyboardEvent)event).getText().length();
    // Zaktualizuj sumę znaków.
    totalCharCount += charCount;
    // Wyświetl komunikat.
    System.out.println("[CharactersCounter] charCount: " + charCount + " | totalCharCount: " + totalCharCount);
  }

}
